import React, { PureComponent } from 'react'
import { PageHeader } from 'ant-design-pro';
import { connect } from 'react-redux';

class Index extends PureComponent{
    render(){
        const props = this.props
        return(
            <PageHeader {...props} />
        );
    }

    componentDidMount(){
        if(this.props.title){
            document.title=this.props.title+"-"+this.props.maintitle;
        }
    }
}

const mapStateToProps=(state)=>{
    const maintitle=state.getIn(['header','title']);
    return {
        maintitle
    };
};

const mapDispatchToProps=(dispatch)=>{
    return {
    };
};

export default connect(mapStateToProps, mapDispatchToProps)(Index)